package com.bite.Queue;

import javax.management.timer.TimerMBean;
import java.util.Timer;
import java.util.concurrent.TimeUnit;

public class Test {
    public static void main(String[] args) throws InterruptedException {
        MyBlockingQueue myBlockingQueue = new MyBlockingQueue(3);
        myBlockingQueue.enQueue(1);
        myBlockingQueue.enQueue(2);
        myBlockingQueue.enQueue(3);
        System.out.println("插入3个数");

        myBlockingQueue.deQueue();
        myBlockingQueue.deQueue();
        myBlockingQueue.deQueue();
        System.out.println("取4个数");

        TimeUnit.SECONDS.sleep(1);

        myBlockingQueue.deQueue();
        System.out.println("取5个数");
    }
}
